-
Notifications
You must be signed in to change notification settings - Fork 7
#13 Refactor usage of roles to add support for delegated devices #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@erwindouna, could you please review my PR? Currently, it is impossible to use MELCloud integration in HA in delegated mode. |
|
Sorry @Kanaduchi this slipped of my radar. I'll spend some time this evening to give it a proper review. |
| ) as resp: | ||
| resp.raise_for_status() | ||
| data = await resp.json() | ||
| if isinstance(data, dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there also a more thorough way to determine the a successful call of this type? HTTP statuscode or content-type returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Status code is checked by raise_for_status. I will add an additional check for content-type. Thank you for the idea
| if self._device_units is None and self.access_level != ACCESS_LEVEL.get( | ||
| "GUEST" | ||
| ): | ||
| if self._device_units is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly, removing the check if the access level is not guest, will allow the usage for delegated devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it because a try-catch block covers this case
Proposed Changes
Related Issues